package com.umeng.analytics.pro;

import android.annotation.SuppressLint;
import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.content.res.Configuration;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.wifi.WifiManager;
import android.os.Build;
import android.os.Environment;
import android.provider.Settings;
import android.telephony.TelephonyManager;
import android.text.TextUtils;
import android.util.DisplayMetrics;
import android.view.WindowManager;

import com.umeng.VersonUtil;
import com.umeng.analytics.AnalyticsConfig;
import com.umeng.analytics.MobclickAgent.EScenarioType;

import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.Reader;
import java.lang.reflect.Field;
import java.net.NetworkInterface;
import java.security.MessageDigest;
import java.security.cert.CertificateFactory;
import java.util.Calendar;
import java.util.Enumeration;
import java.util.Locale;
import java.util.Properties;

import javax.microedition.khronos.opengles.GL10;

public class bv {
    protected static final String a = bv.class.getName();
    public static final String b = "";
    public static final String c = "2G/3G";
    public static final String d = "Wi-Fi";
    public static final int e = 8;
    private static final String f = "ro.miui.ui.version.name";

    public bv() {

    }

    @SuppressLint("MissingPermission")
    public static String A(Context arg3) {
        String v0_2 = null;
        if (arg3 != null) {
            try {
                Object v0_1 = arg3.getSystemService(Context.TELEPHONY_SERVICE);
                if (v0_1 == null) {
                    return null;
                } else if (bv.a(arg3, "android.permission.READ_PHONE_STATE")) {
                    v0_2 = ((TelephonyManager) v0_1).getDeviceId();
                } else {
                    return null;
                }
                if (!TextUtils.isEmpty(v0_2)) {
                    return v0_2;
                }
                v0_2 = Settings.Secure.getString(arg3.getContentResolver(), "android_id");
                if (!TextUtils.isEmpty(v0_2)) {
                    return v0_2;
                }
                if (Build.VERSION.SDK_INT < 9) {
                    return v0_2;
                }
                v0_2 = Build.SERIAL;
            } catch (Throwable v1_1) {
            }
        } else {
            return null;
        }
        return v0_2;
    }

    private static Locale B(Context arg5) {
        Locale v0 = null;
        try {
            Configuration v1_1 = new Configuration();
            v1_1.setToDefaults();
            Settings.System.getConfiguration(arg5.getContentResolver(), v1_1);
            v0 = v1_1.locale;
        } catch (Throwable v1) {
            by.c(bv.a, new Object[]{"fail to read user config locale"});
        }

        if (v0 == null) {
            v0 = Locale.getDefault();
        }

        return v0;
    }

    private static String C(Context arg2) {
        String v0_2;
        try {
            Object v0_1 = arg2.getSystemService(Context.WIFI_SERVICE);
            if (!bv.a(arg2, "android.permission.ACCESS_WIFI_STATE")) {
                return "";
            }

            v0_2 = ((WifiManager) v0_1).getConnectionInfo().getMacAddress();
        } catch (Throwable v0) {
            v0_2 = "";
        }

        return v0_2;
    }

    private static String D(Context arg2) {
        String v0;
        int v1 = 23;
        if (Build.VERSION.SDK_INT < v1) {
            v0 = bv.F(arg2);
            if (TextUtils.isEmpty(((CharSequence) v0))) {
                v0 = bv.C(arg2);
                if (TextUtils.isEmpty(((CharSequence) v0))) {
                    v0 = Settings.Secure.getString(arg2.getContentResolver(), "android_id");
                    if (TextUtils.isEmpty(((CharSequence) v0))) {
                        v0 = bv.d();
                    }
                }
            }
        } else if (Build.VERSION.SDK_INT == v1) {
            v0 = bv.F(arg2);
            if (TextUtils.isEmpty(((CharSequence) v0))) {
                v0 = bv.b();
                if (TextUtils.isEmpty(((CharSequence) v0))) {
                    v0 = com.umeng.analytics.a.d ? bv.c() : bv.C(arg2);
                }

                if (!TextUtils.isEmpty(((CharSequence) v0))) {
                    return v0;
                }

                v0 = Settings.Secure.getString(arg2.getContentResolver(), "android_id");
                if (!TextUtils.isEmpty(((CharSequence) v0))) {
                    return v0;
                }

                v0 = bv.d();
            }
        } else {
            v0 = bv.F(arg2);
            if (!TextUtils.isEmpty(((CharSequence) v0))) {
                return v0;
            }

            v0 = bv.d();
            if (!TextUtils.isEmpty(((CharSequence) v0))) {
                return v0;
            }

            v0 = Settings.Secure.getString(arg2.getContentResolver(), "android_id");
            if (!TextUtils.isEmpty(((CharSequence) v0))) {
                return v0;
            }

            v0 = bv.b();
            if (!TextUtils.isEmpty(((CharSequence) v0))) {
                return v0;
            }

            v0 = bv.C(arg2);
        }

        return v0;
    }

    private static String E(Context arg2) {
        String v0;
        int v1 = 23;
        if (Build.VERSION.SDK_INT < v1) {
            v0 = Settings.Secure.getString(arg2.getContentResolver(), "android_id");
            if (TextUtils.isEmpty(((CharSequence) v0))) {
                v0 = bv.C(arg2);
                if (TextUtils.isEmpty(((CharSequence) v0))) {
                    v0 = bv.d();
                    if (TextUtils.isEmpty(((CharSequence) v0))) {
                        v0 = bv.F(arg2);
                    }
                }
            }
        } else if (Build.VERSION.SDK_INT == v1) {
            v0 = Settings.Secure.getString(arg2.getContentResolver(), "android_id");
            if (TextUtils.isEmpty(((CharSequence) v0))) {
                v0 = bv.b();
                if (TextUtils.isEmpty(((CharSequence) v0))) {
                    v0 = com.umeng.analytics.a.d ? bv.c() : bv.C(arg2);
                }

                if (!TextUtils.isEmpty(((CharSequence) v0))) {
                    return v0;
                }

                v0 = bv.d();
                if (!TextUtils.isEmpty(((CharSequence) v0))) {
                    return v0;
                }

                v0 = bv.F(arg2);
            }
        } else {
            v0 = Settings.Secure.getString(arg2.getContentResolver(), "android_id");
            if (!TextUtils.isEmpty(((CharSequence) v0))) {
                return v0;
            }

            v0 = bv.d();
            if (!TextUtils.isEmpty(((CharSequence) v0))) {
                return v0;
            }

            v0 = bv.F(arg2);
            if (!TextUtils.isEmpty(((CharSequence) v0))) {
                return v0;
            }

            v0 = bv.b();
            if (!TextUtils.isEmpty(((CharSequence) v0))) {
                return v0;
            }

            v0 = bv.C(arg2);
        }

        return v0;
    }

    @SuppressLint("MissingPermission")
    private static String F(Context arg3) {
        String v0_2;
        String v1 = "";
        Object v0 = arg3.getSystemService(Context.TELEPHONY_SERVICE);
        if (v0 != null) {
            try {
                if (bv.a(arg3, "android.permission.READ_PHONE_STATE")) {
                    return ((TelephonyManager) v0).getDeviceId();
                } else {
                    return "";
                }
            } catch (Throwable v0_1) {
                return "";
            }
        }
        return "";
    }

    public static String[] a(GL10 arg5) {
        String[] v0_2;
        int v0 = 2;
        try {
            v0_2 = new String[v0];
            String v1 = arg5.glGetString(7936);
            String v2 = arg5.glGetString(7937);
            v0_2[0] = v1;
            v0_2[1] = v2;
        } catch (Throwable v0_1) {
            v0_2 = new String[0];
        }

        return v0_2;
    }

    public static boolean a(Context arg7, String arg8) {
        if (Build.VERSION.SDK_INT >= 23) {
            try {
                if (((Integer) Class.forName("android.content.Context").getMethod("checkSelfPermission", String.class).invoke(arg7, arg8)).intValue() != 0) {
                    return false;
                }
            } catch (Throwable v0) {
                boolean v0_1 = false;
                return v0_1;
            }

            return true;
        }

        return arg7.getPackageManager().checkPermission(arg8, arg7.getPackageName()) == PackageManager.PERMISSION_GRANTED ? true : false;
    }

    public static String a(Context arg1) {
        return VersonUtil.getVersionCode();
    }

    public static String a() {
        String v1 = null;
        try {
            FileReader v0_1 = new FileReader("/proc/cpuinfo");
            try {
                BufferedReader v2 = new BufferedReader(((Reader) v0_1), 1024);
                v1 = v2.readLine();
                v2.close();
                v0_1.close();
            } catch (Throwable v0_2) {
                by.e(bv.a, "Could not read from file /proc/cpuinfo", v0_2);
            }
        } catch (FileNotFoundException v0) {
            by.e(bv.a, "Could not open file /proc/cpuinfo", v0);
        }

        String v0_3 = v1 != null ? v1.substring(v1.indexOf(58) + 1).trim() : "";
        return v0_3;
    }

    private static int a(Object arg2, String arg3) {
        int v0_2;
        try {
            Field v0_1 = DisplayMetrics.class.getDeclaredField(arg3);
            v0_1.setAccessible(true);
            v0_2 = v0_1.getInt(arg2);
        } catch (Throwable v0) {
            v0_2 = -1;
        }

        return v0_2;
    }

    private static String a(String arg4) {
        BufferedReader v2 = null;
        FileReader v3 = null;
        String v0 = null;
        try {
            v3 = new FileReader(arg4);
            v2 = new BufferedReader(((Reader) v3), 1024);
            v0 = v2.readLine();
            return v0;
        } catch (Throwable v1) {
            return v0;
        } finally {
            if (v2 != null) {
                try {
                    v2.close();
                } catch (Throwable v3_1) {
                }
            }
            if (v3 != null) {
                try {
                    v3.close();
                } catch (Throwable v3_1) {
                }
            }
        }
    }

    private static String a(Properties arg2) {
        String v0 = arg2.getProperty("ro.yunos.version");
        if (TextUtils.isEmpty(((CharSequence) v0))) {
            v0 = null;
        }

        return v0;
    }

    private static String a(byte[] arg6) {
        StringBuilder v2 = new StringBuilder(arg6.length << 1);
        int v0;
        for (v0 = 0; v0 < arg6.length; ++v0) {
            String v1 = Integer.toHexString(arg6[v0]);
            int v3 = v1.length();
            if (v3 == 1) {
                v1 = "0" + v1;
            }

            if (v3 > 2) {
                v1 = v1.substring(v3 - 2, v3);
            }

            v2.append(v1.toUpperCase(Locale.getDefault()));
            if (v0 < arg6.length - 1) {
                v2.append(':');
            }
        }

        return v2.toString();
    }

    public static String b(Context arg1) {
        return VersonUtil.getVersionName();
    }

    private static String b() {
        int v0_2;
        StringBuilder v4;
        Object v0_1;
        String v1 = null;
        try {
            Enumeration v3 = NetworkInterface.getNetworkInterfaces();
            do {
                if (!v3.hasMoreElements()) {
                    return v1;
                }

                v0_1 = v3.nextElement();
                if ("wlan0".equals(((NetworkInterface) v0_1).getName())) {
                    break;
                }
            }
            while (!"eth0".equals(((NetworkInterface) v0_1).getName()));

            byte[] v3_1 = ((NetworkInterface) v0_1).getHardwareAddress();
            int v5;
            if (v3_1 != null && v3_1.length != 0) {
                v4 = new StringBuilder();
                v5 = v3_1.length;
                v0_2 = 0;
            } else {
                String v0_3 = v1;
                return v0_3;
            }

            while (v0_2 < v5) {
                v4.append(String.format("%02X:", Byte.valueOf(v3_1[v0_2])));
                ++v0_2;
            }
            if (v4.length() > 0) {
                v4.deleteCharAt(v4.length() - 1);
            }
            return v4.toString().toLowerCase(Locale.getDefault());
        } catch (Throwable v0) {
        }

        return v1;
    }

    private static String b(Properties arg2) {
        try {
            String v0_1 = arg2.getProperty("ro.build.display.id").toLowerCase(Locale.getDefault());
            if (!v0_1.contains("flyme os")) {
                return null;
            }

            return v0_1.split(" ")[2];
        } catch (Throwable v0) {
        }

        return null;
    }

    public static String c(Context arg2) {
        String v0 = EScenarioType.E_UM_ANALYTICS_OEM.toValue() == AnalyticsConfig.getVerticalType(arg2)
                || EScenarioType.E_UM_GAME_OEM.toValue() == AnalyticsConfig.getVerticalType(arg2)
                ? bv.E(arg2)
                : bv.D(arg2);
        return v0;
    }

    private static String c() {
        String[] v2;
        int v4 = 3;
        int v1 = 3;
        try {
            v2 = new String[v1];
            v2[0] = "/sys/class/net/wlan0/address";
            v2[1] = "/sys/class/net/eth0/address";
            v2[2] = "/sys/devices/virtual/net/wlan0/address";
            v1 = 0;
        } catch (Throwable v0) {
            return null;
        }

        while (v1 < v4) {
            try {
                String v0_1 = bv.a(v2[v1]);
                if (v0_1 == null) {
                } else {
                    return v0_1;
                }
            } catch (Throwable v0) {
            }
            ++v1;
        }

        return null;
    }

    public static String d(Context arg1) {
        return bw.b(bv.c(arg1));
    }

    private static String d() {
        String v0 = "";
        if (Build.VERSION.SDK_INT >= 9) {
            v0 = Build.SERIAL;
        }

        return v0;
    }

    public static String e(Context arg5) {
        String v0 = null;
        if (bv.f(arg5) != null) {
            int v1 = arg5.getResources().getConfiguration().mcc;
            int v2 = arg5.getResources().getConfiguration().mnc;
            if (v1 != 0) {
                v0 = String.valueOf(v2);
                if (v2 < 10) {
                    v0 = String.format("%02d", Integer.valueOf(v2));
                }

                v0 = new StringBuffer().append(String.valueOf(v1)).append(v0).toString();
            }
        }

        return v0;
    }

    private static Properties e() {
        FileInputStream v0_1 = null;
        Properties v2 = new Properties();
        FileInputStream v1 = null;
        try {
            v0_1 = new FileInputStream(new File(Environment.getRootDirectory(), "build.prop"));
            v2.load(v0_1);
            return v2;
        } catch (Exception e) {
            return v2;
        } finally {
            if (v0_1 != null) {
                try {
                    v0_1.close();
                } catch (Throwable v0) {
                }
            }
        }
    }

    @SuppressLint("MissingPermission")
    public static String f(Context arg3) {
        Object v0 = arg3.getSystemService(Context.TELEPHONY_SERVICE);
        String v1 = null;
        String v0_1 = bv.a(arg3, "android.permission.READ_PHONE_STATE") ? ((TelephonyManager) v0).getSubscriberId() : v1;
        return v0_1;
    }

    private static boolean f() {
        try {
            Build.class.getMethod("hasSmartBar");
        } catch (Throwable v1) {
        }

        return true;
    }

    public static String g(Context arg3) {
        Object v0 = arg3.getSystemService(Context.TELEPHONY_SERVICE);
        String v1 = null;
        String v0_1 = bv.a(arg3, "android.permission.READ_PHONE_STATE") ? ((TelephonyManager) v0).getNetworkOperator() : v1;
        return v0_1;
    }

    public static String h(Context arg2) {
        try {
            Object v0_1 = arg2.getSystemService(Context.TELEPHONY_SERVICE);
            if (!bv.a(arg2, "android.permission.READ_PHONE_STATE")) {
                return "";
            }

            if (v0_1 == null) {
                return "";
            }

            String v0_2 = ((TelephonyManager) v0_1).getNetworkOperatorName();
            return v0_2;
        } catch (Throwable v0) {
        }

        return "";
    }

    public static String i(Context arg3) {
        String v0_1;
        try {
            DisplayMetrics v1 = new DisplayMetrics();
            ((WindowManager) arg3.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay().getMetrics(v1);
            v0_1 = String.valueOf(v1.heightPixels) + "*" + String.valueOf(v1.widthPixels);
        } catch (Throwable v0) {
            v0_1 = "";
        }

        return v0_1;
    }

    public static String[] j(Context arg4) {
        String[] v1 = new String[]{"", ""};
        try {
            if (!bv.a(arg4, "android.permission.ACCESS_NETWORK_STATE")) {
                v1[0] = "";
                String[] v0_1 = v1;
                return v0_1;
            }

            Object v0_2 = arg4.getSystemService(Context.CONNECTIVITY_SERVICE);
            if (v0_2 == null) {
                v1[0] = "";
                return v1;
            }

            NetworkInfo v2 = ((ConnectivityManager) v0_2).getNetworkInfo(1);
            if (v2 != null && v2.getState() == NetworkInfo.State.CONNECTED) {
                v1[0] = "Wi-Fi";
                return v1;
            }

            NetworkInfo v0_3 = ((ConnectivityManager) v0_2).getNetworkInfo(0);
            if (v0_3 == null) {
                return v1;
            }

            if (v0_3.getState() != NetworkInfo.State.CONNECTED) {
                return v1;
            }

            v1[0] = "2G/3G";
            v1[1] = v0_3.getSubtypeName();
            return v1;
        } catch (Throwable v0) {
        }

        return v1;
    }

    public static boolean k(Context arg3) {
        return "Wi-Fi".equals(bv.j(arg3)[0]);
    }

    public static boolean l(Context arg1) {
        try {
            if (!bv.a(arg1, "android.permission.ACCESS_NETWORK_STATE")) {
                return false;
            }

            Object v0_1 = arg1.getSystemService(Context.CONNECTIVITY_SERVICE);
            if (v0_1 == null) {
                return false;
            }

            NetworkInfo v0_2 = ((ConnectivityManager) v0_1).getActiveNetworkInfo();
            if (v0_2 == null) {
                return false;
            }

            boolean v0_3 = v0_2.isConnectedOrConnecting();
            return v0_3;
        } catch (Throwable v0) {
        }

        return false;
    }

    public static int m(Context arg3) {
        try {
            Calendar v0_1 = Calendar.getInstance(bv.B(arg3));
            if (v0_1 == null) {
                return 8;
            }

            int v0_2 = v0_1.getTimeZone().getRawOffset() / 3600000;
            return v0_2;
        } catch (Throwable v0) {
            by.c(bv.a, "error in getTimeZone", v0);
        }

        return 8;
    }

    public static boolean n(Context arg4) {
        boolean v0 = true;
        String v2 = af.a(arg4).b().e("");
        if (TextUtils.isEmpty(((CharSequence) v2))) {
            if (bv.f(arg4) == null) {
                v2 = bv.o(arg4)[0];
                if (!TextUtils.isEmpty(((CharSequence) v2)) && (v2.equalsIgnoreCase("cn"))) {
                    return v0;
                }
            } else {
                int v2_1 = arg4.getResources().getConfiguration().mcc;
                if (v2_1 == 460) {
                    return v0;
                } else if (v2_1 == 461) {
                    return v0;
                } else if (v2_1 == 0) {
                    v2 = bv.o(arg4)[0];
                    if (!TextUtils.isEmpty(((CharSequence) v2)) && (v2.equalsIgnoreCase("cn"))) {
                        return v0;
                    }
                }
            }

            v0 = false;
        } else if (!v2.equals("cn")) {
            v0 = false;
        }

        return v0;
    }

    public static String[] o(Context arg4) {
        String[] v0 = new String[2];
        try {
            Locale v1_1 = bv.B(arg4);
            if (v1_1 != null) {
                v0[0] = v1_1.getCountry();
                v0[1] = v1_1.getLanguage();
            }

            if (TextUtils.isEmpty(v0[0])) {
                v0[0] = "Unknown";
            }

            if (!TextUtils.isEmpty(v0[1])) {
                return v0;
            }

            v0[1] = "Unknown";
        } catch (Throwable v1) {
            by.e(bv.a, "error in getLocaleInfo", v1);
        }

        return v0;
    }

    public static String p(Context arg4) {
        try {
            ApplicationInfo v0_1 = arg4.getPackageManager().getApplicationInfo(arg4.getPackageName(), PackageManager.GET_META_DATA);
            if (v0_1 == null) {
                return null;
            }

            String v0_2 = v0_1.metaData.getString("UMENG_APPKEY");
            if (v0_2 != null) {
                return v0_2.trim();
            }

            by.c(bv.a, new Object[]{"getAppkey failed. the applicationinfo is null!"});
        } catch (Throwable v0) {
            by.e(bv.a, "Could not read UMENG_APPKEY meta-data from AndroidManifest.xml.", v0);
        }

        return null;
    }

    public static String q(Context arg2) {
        String v0;
        int v1 = 23;
        if (Build.VERSION.SDK_INT < v1) {
            v0 = bv.C(arg2);
        } else if (Build.VERSION.SDK_INT == v1) {
            v0 = bv.b();
            if (TextUtils.isEmpty(((CharSequence) v0))) {
                v0 = com.umeng.analytics.a.d ? bv.c() : bv.C(arg2);
            }
        } else {
            v0 = bv.b();
            if (TextUtils.isEmpty(((CharSequence) v0))) {
                v0 = bv.C(arg2);
            }
        }

        return v0;
    }

    public static int[] r(Context arg4) {
        int[] v0_2;
        int v0_1;
        int v1;
        DisplayMetrics v3;
        int v2 = -1;
        try {
            v3 = new DisplayMetrics();
            ((WindowManager) arg4.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay().getMetrics(v3);
            if ((arg4.getApplicationInfo().flags & 8192) == 0) {
                v1 = bv.a(v3, "noncompatWidthPixels");
                v0_1 = bv.a(v3, "noncompatHeightPixels");
            } else {
                v0_1 = 0;
                v1 = v2;
            }
            if (v1 == v2 || v0_1 == v2) {
                v2 = v3.widthPixels;
                v1 = v3.heightPixels;
            } else {
                v2 = v1;
                v1 = v0_1;
            }
            v0_2 = new int[2];
            if (v2 > v1) {
                v0_2[0] = v1;
                v0_2[1] = v2;
                return v0_2;
            }

            v0_2[0] = v2;
            v0_2[1] = v1;
        } catch (Throwable v0) {
            v0_2 = null;
        }

        return v0_2;
    }

    public static String s(Context arg1) {
        return VersonUtil.getUmengChannel();
    }

    public static String t(Context arg1) {
        return arg1.getPackageName();
    }

    public static String u(Context arg4) {
        String v0_1;
        String v1 = null;
        try {
            v0_1 = bv.a(MessageDigest.getInstance("MD5")
                    .digest(CertificateFactory.getInstance("X509")
                            .generateCertificate(new ByteArrayInputStream(arg4.getPackageManager()
                                    .getPackageInfo(bv.t(arg4), PackageManager.GET_SIGNATURES).signatures[0].toByteArray())).getEncoded()));
        } catch (Throwable v0) {
            v0_1 = v1;
        }

        return v0_1;
    }

    public static String v(Context arg2) {
        return arg2.getPackageManager().getApplicationLabel(arg2.getApplicationInfo()).toString();
    }

    public static String w(Context arg4) {
        String v0 = null;
        try {
            v0 = arg4.getPackageManager().getPackageInfo(arg4.getPackageName(), 0).applicationInfo.loadLabel(arg4.getPackageManager()).toString();
        } catch (Throwable v1) {
        }

        return v0;
    }

    public static String x(Context arg3) {
        String v0_1;
        Properties v1 = bv.e();
        try {
            v0_1 = v1.getProperty("ro.miui.ui.version.name");
            if (TextUtils.isEmpty(v0_1)) {
                if (bv.f()) {
                    return "Flyme";
                }

                if (TextUtils.isEmpty(bv.a(v1))) {
                    return v0_1;
                }

                return "YunOS";
            }

            v0_1 = "MIUI";
        } catch (Throwable v0) {
            v0_1 = null;
        }

        return v0_1;
    }

    public static String y(Context arg3) {
        String v0_1;
        Properties v1 = bv.e();
        try {
            v0_1 = v1.getProperty("ro.miui.ui.version.name");
            if (!TextUtils.isEmpty(((CharSequence) v0_1))) {
                return v0_1;
            }

            if (!bv.f()) {
                try {
                    v0_1 = bv.a(v1);
                } catch (Throwable v1_1) {
                }
                return v0_1;
            }
        } catch (Throwable v0) {
            return null;
        }

        try {
            v0_1 = bv.b(v1);
        } catch (Throwable v1_1) {
        }

        return v0_1;

    }

    public static String z(Context arg2) {
        String v0 = "Phone";
        if (arg2 != null) {
            int v0_1 = (arg2.getResources().getConfiguration().screenLayout & 15) >= 3 ? 1 : 0;
            if (v0_1 != 0) {
                return "Tablet";
            }

            v0 = "Phone";
        }

        return v0;
    }
}

